import { createApp } from "vue";
import App from "./App.vue";
import Hello from "./Hello.vue";

// 创建应用
const app = createApp(App);

// 注册全局组件
app.component("Hello", Hello);
// 全局配置
app.config.globalProperties.x = 99;
declare module "vue" {
  interface ComponentCustomProperties {
    x: number;
  }
}
// 注册全局指定
app.directive("beauty", (element, { value }) => {
  element.innerText += value;
  element.style.color = "green";
  element.style.backgroundColor = "yellow";
});
// 挂载应用
app.mount("#app");
// 卸载应用
setTimeout(() => {
  app.unmount();
}, 2000);
